package com.huluobo.a2109amvvmdemo.room;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

/**
 * Created by LC on 2023/11/30.
 * 1.@Entity(tableName = "account") 标记一个实体类为一个数据库对应的表
 * 2.@PrimaryKey(autoGenerate = true) 标记一个属性为主键自增
 * 3.@ColumnInfo(name = "_loginAccount") 标记一个属性为列名(字段)
 * 4.创建表的时候,尽量不要嵌套,即使嵌套,也不要在外层的bean中嵌套,比如油焖大虾
 */

@Entity(tableName = "account")
public class AccountBean {
    @PrimaryKey(autoGenerate = true)
    public int accountId = 0;

    @ColumnInfo(name = "_loginAccount")
    public String loginAccount;

    @ColumnInfo(name = "_loginPassword")
    public String loginPassword;

    public AccountBean(String loginAccount, String loginPassword) {
        this.loginAccount = loginAccount;
        this.loginPassword = loginPassword;
    }
}
